using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Login : System.Web.UI.Page
{
    UserDAO daoUser = new UserDAO();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
       // this.Validate();
       // if (!IsValid) return;
        if (daoUser.checkAccount(txtUID.Text, txtPass.Text))
        {
            Session["logedin"] = true;
            Session["user"] = txtUID.Text;
            Response.Redirect("Default.aspx");
        }
        else lblError.Text = "UserID or password is not valid. Please try again.";
    }
}
